import request from '@/utils/request'
export function fetchSalesmanList(params) {
  return request({
    url:'/admin/distributor/list',
    method:'get',
    params:params
  })
}

export function updateSalesmanInfo(uid,info) {
    return request({
      url:'/admin/distributor/update/'+uid,
      method:'post',
      data:info
    })
}
export function newSalesmanInfo(info) {
    return request({
      url:'/admin/distributor/add',
      method:'post',
      data:info
    })
}
export function deleteSalesman(uid) {
    return request({
      url:'/admin/distributor/del/'+uid,
      method:'post'
    })
}

export function fetchSalesDiscountList(params) {
  return request({
    url:'/admin/distributor/discount/list',
    method:'get',
    params:params
  })
}
export function newPromotionInfo(info) {
  return request({
    url:'/admin/distributor/discount/add',
    method:'post',
    data:info
  })
}
export function deletePromotion(uid) {
  return request({
    url:'/admin/distributor/discount/del/'+uid,
    method:'post'
  })
}
export function updatePromotionInfo(uid,params) {
  return request({
    url:'/admin/distributor/discount/update/'+uid,
    method:'post',
    params:params
  })
}

export function setSalesmanRadio(uid,params) {
  return request({
    url:'/admin/distributor/discount/tatio/config',
    method:'post',
    data:{
      distributorId:uid,
      tatio:params
    }
  })
}
export function deleteSalemanPromotion(id) {
  return request({
    url:'/admin/distributor/discount/del/'+id,
    method:'post'
  })
}